layui.use('layer',function () {
    layer = layui.layer;
});
function login(){
	var name = $("#name").val();
	var password = $("#password").val();
	var url = config.servicePath + '/rentHouse/user/loginCheck';
	$.ajax({
		type: 'post',
		url: url,
		data:{'name':name, 'password':password},
		dataType: 'json',
		success:function(result){
			var code = result.code;
			if(code=="0"){
				var ETtoken = result.data.ETtoken;
				sessionStorage.setItem("ETtoken", ETtoken);
				sessionStorage.setItem("name", name);
				window.location.href = config.servicePath + "/panda/home.html";
			}else{
				layer.alert('用户名或密码有误');
			}
		},
		error:function(e){
			layer.alert('网络出错');
		}
	});
}